﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:MVVMFramework.View">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/MVVMFramework.View;component/Themes/Colors.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <local:BoolInvenrseConverter x:Key="BoolInvenrse"/>
    <local:BoolToVisibilityConverter x:Key="VisibleIfTrue"/>
    <local:BoolToVisibilityConverter x:Key="CollapsedIfTrue" IsReversed="True"/>
    <local:BooleanOrConverter x:Key="BooleanOrConverter"/>
    <local:BooleanAndConverter x:Key="BooleanAndConverter"/>

    <Geometry x:Key="DownArrowGeometry">M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z</Geometry>

    <DataTemplate x:Key="IncreaseGlyphNormalKey">
        <Path Width="7"
            Height="4"
            Data="{StaticResource UpArrowGeometry}"
            Fill="Black"
            SnapsToDevicePixels="True"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Focusable="False" />
    </DataTemplate>
    <DataTemplate x:Key="IncreaseGlyphDisabledKey">
        <Path	Width="7"
            Height="4"
            Data="{StaticResource UpArrowGeometry}"
            Fill="Gray"
            SnapsToDevicePixels="True"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Focusable="False" />
    </DataTemplate>

    <DataTemplate x:Key="DecreaseGlyphNormalKey">
        <Path Width="7"
            Height="4"
            Data="{StaticResource DownArrowGeometry}"
            Fill="Black"
            SnapsToDevicePixels="True"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Focusable="False" />
    </DataTemplate>

    <DataTemplate x:Key="DecreaseGlyphDisabledKey">
        <Path	Width="7"
            Height="4"
            Data="{StaticResource DownArrowGeometry}"
            Fill="Gray"
            SnapsToDevicePixels="True"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Focusable="False" />
    </DataTemplate>

    <ControlTemplate x:Key="DropDownToggleButtonStyle" TargetType="ToggleButton">
        <Grid Background="Transparent">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition SharedSizeGroup="ToggleButton" Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                    Background="{TemplateBinding Background}" Grid.Column="1" SnapsToDevicePixels="True" Width="16">
                <Path x:Name="ArrowDownPath" Data="M4,1L10,1 7,4z" Fill="Black" VerticalAlignment="Center"/>
            </Border>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="BorderBrush" TargetName="Chrome" Value="{x:Null}"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver" Value="True"/>
                    <Condition Property="IsChecked" Value="False"/>
                </MultiTrigger.Conditions>
                <Setter Property="Background" TargetName="Chrome" Value="{StaticResource HoverInnerBackgroundBrush}"/>
                <Setter Property="BorderBrush" TargetName="Chrome" Value="{StaticResource CommonBorderBrush}"/>
            </MultiTrigger>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="BorderBrush" TargetName="Chrome" Value="{StaticResource CommonBorderBrush}"/>
                <Setter Property="Background" TargetName="Chrome" Value="{StaticResource PressedInnerBackgroundBrush}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" TargetName="Chrome" Value="{StaticResource PressedInnerBackgroundBrush}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Fill" TargetName="ArrowDownPath" Value="#FFB5B2B5"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="HorizontalGridSplitterStyle" TargetType="{x:Type GridSplitter}">
        <Setter Property="FrameworkElement.Height" Value="8"/>
        <!--<Setter Property="TextElement.Foreground" Value="#FF204D89" />-->
        <!--<Setter Property="Border.BorderBrush" Value="#FF6593CF" />-->
        <!--<Setter Property="Panel.Background" Value="{StaticResource panelBackgroundBrush}" />-->
        <Setter Property="Border.BorderThickness" Value="0,1,0,0" />
        <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
        <Setter Property="UIElement.Focusable" Value="False" />
        <Setter Property="Control.Padding" Value="7,7,7,7" />
        <Setter Property="FrameworkElement.Cursor" Value="SizeNS" />
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border BorderThickness="{TemplateBinding Border.BorderThickness}" BorderBrush="{TemplateBinding Border.BorderBrush}" Background="{TemplateBinding Panel.Background}">
                        <Border BorderThickness="1,1,0,0">
                            <Canvas Width="19" Height="3">
                                <!--<Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="1" Canvas.Top="0" />
                                <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="5" Canvas.Top="0" />
                                <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="9" Canvas.Top="0" />
                                <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="13" Canvas.Top="0" />
                                <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="17" Canvas.Top="0" />-->
                                <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="0" />
                                <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="4" Canvas.Top="0" />
                                <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="8" Canvas.Top="0" />
                                <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="12" Canvas.Top="0" />
                                <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="16" Canvas.Top="0" />
                            </Canvas>
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>